from django.db import models
from django.contrib.auth.models import User


class UserProfile(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='profile')
    role = models.CharField(max_length=10, verbose_name='角色')

    class Meta:
        verbose_name = '用户扩展信息'
        verbose_name_plural = verbose_name
        db_table = 'auth_profile'

    def __str__(self):
        return self.user.__str__()

